<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script src="<c:url value="/resources/js/jquery-1.7.2.min.js" />" /></script>
<script>
	$(document).ready(function() {
		$(this).find(".ui-slider-handle").removeClass("ui-state-default");
		$("#slider").hover(function() {
			var obj = $(this).find(".ui-slider-handle");
			obj.removeClass("ui-state-hover");
			obj.removeClass("ui-state-focus");
			obj.removeClass("ui-state-active");
		});
		$("#slider").mousedown(function() {
			var obj = $(this).find(".ui-slider-handle");
			obj.removeClass("ui-state-hover");
			obj.removeClass("ui-state-focus");
			obj.removeClass("ui-state-active");
		});
		$("#slider").mousemove(function() {
			var obj = $(this).find(".ui-slider-handle");
			obj.removeClass("ui-state-hover");
			obj.removeClass("ui-state-focus");
			obj.removeClass("ui-state-active");
			obj.removeClass("ui-state-default");
			obj.css("outline","none");
		});
	});

	jQuery.noConflict();
	$(document).ready(function() {

		//Store frequently elements in variables
		var slider = $('#slider');

		//Call the Slider
		slider.slider({
			//Config
			range : "min",
			min : 0,
			max : 2,
			value : 0,
		    slide: function( event, ui ) {
		    	var valueSpan = ui.value;
		    	if (valueSpan == 0) {
		    		$('#lblnumStop').text(valueSpan + " (direct)");
		    	}
		    	else if (valueSpan == 1) {
		    		$('#lblnumStop').text(valueSpan + " stop");
		    	}
		    	else if (valueSpan == 2) {
		    		$('#lblnumStop').text(valueSpan + "+ (any)");
		    	}

		    	$('#numStop').val(valueSpan);
		    	$('#txtnumStop').val(valueSpan);
		    }


		});

		var valueSpan=$('#numStop').val();
		if (valueSpan == 0) {
    		$('#lblnumStop').text(valueSpan + " (direct)");
    	}
    	else if (valueSpan == 1) {
    		$('#lblnumStop').text(valueSpan + " stop");
    	}
    	else if (valueSpan == 2) {
    		$('#lblnumStop').text(valueSpan + "+ (any)");
    	}
		$("#slider").slider("option", "value", valueSpan);

	});
</script>